The image compressing technology for reducing the amount of data by compressing image data is used for equipment in various fields. An in-vehicle device belongs to one of the fields. To apply the image compressing technology to moving pictures displayed on the in-vehicle device, the following conditions are to be satisfied.
(1) High Image Quality
It is necessary to attain high image quality both in natural images and CG (computer graphics) images. Well known as the image information processed in an in-vehicle device are natural images represented by common television images, movies, etc., and CG images (digital images) represented by a map of a car navigation system etc. They are quite different from each other in characteristics of the images. That is, natural images include many low frequency components and digital images include many high frequency components. In the recent in-vehicle devices and mobile terminals such as cellular phones, both digital images such as maps etc. and natural images such as television images, movies etc. are processed, and effective image compressing technology has been demanded for the images different in characteristics.
(2) Low Delay
Video information is transmitted normally by an in-vehicle local area network (LAN). In this case, to display equivalent images between front seats and rear seats in a vehicle without a delay of screen display, it is necessary to quickly perform compressing, transmitting, and decompressing processes with less delay.
(3) Light in Weight
When a multiplex transmission is performed, an image compression device and an image decompression device are required for each LAN terminal. Therefore, each device is to have a small circuit and to be light in weight.
A prediction coding method for predicting a pixel value for each pixel is known as a variation of image compressing technology. In the image compressing technology using the prediction coding method, the amount of generated code can be precisely adjusted for both images having different characteristics such as natural images and CG images by changing the quantizing step width.
FIG. 1 illustrates the image compressing process using the prediction coding method. A predictor 102 predicts the pixel value of a target pixel from the pixel values of the surrounding pixels when uncompressed input data 101 is input, and outputs the difference between an actual pixel value and a predicted value as a prediction error.
For example, in a normal plane prediction, as illustrated in FIG. 2, the pixel value X of a target pixel 214 on a target line 202 is predicted using an adjacent pixel 213 on the target line 202 and the adjacent pixels 211 and 212 on an immediately preceding line 201. Assuming that the pixel values of the pixels 213, 211, and 212 are A, B, and C respectively, the predicted value X′ of the target pixel 214 is obtained by the following equation.X′=A+C−B  (1)
In this case, the prediction is made based on the assumption that the image is generally flat, and the pixel values of the adjacent pixels are generally close to one another.
Next, a quantizer 103 quantizes the prediction error X−X′ and converts it into a representative value. Depending on the size of the quantizing step width used by the quantizer 103, the representative values for the same input data 101 are different.
Next, a variable length coder 104 assigns a variable length code depending on the frequency of occurrence of the representative value, and generates a compression code. Since the code length of the variable length code is normally inverse proportional to the frequency of occurrence, the code lengths are different when representative values are different. Therefore, the compression efficiency for the input data 101 depends on the size of the quantizing step width.
FIG. 3 illustrates an example of a quantization representative value when the quantizing step width is small. The horizontal axis indicates the prediction error output from the predictor 102, and the vertical axis indicates the frequency of occurrence of a prediction error. In this example, prediction errors −30 through +30 are divided into five quantizing steps 301 through 305, and the representative values are −18, −6, 0, +6, and +18 respectively. In this case, the code lengths of the representative values −18 and +18 are the longest, the code lengths of the representative values −6 and +6 are intermediate, and the code lengths of the representative values 0 is the shortest.
On the other hand, FIG. 4 illustrates an example of a quantization representative value when the quantizing step width is large. In this example, the prediction error −30 through +30 are divided into three quantizing steps 401 through 403, and the representative values are −15, 0, and +15 respectively. As with the case in FIG. 3, the code lengths of the representative value 0 is the shortest, but the representative values −15 and +15 can be assigned intermediate code lengths.
Thus, a quantizer having a small quantizing step width generates a small quantization error (good image quality), but its compression efficiency is reduced. On the other hand, since a quantizer having a large quantizing step width indicates a short total code length, its compression efficiency is enhanced, but the quantization error is large (degraded image quality).
In the image compressing process above, a method for selectively switching different types of prediction algorithms is known (for example, refer to Patent Document 1). In this method, when different types of voice signals coexist, two predictors which operate with different prediction algorithms are provided, and it is determined by a mode determination as to which predicted value is used in outputting code.
In addition, a feedback-type code amount controlling method is also known (for example, refer to Patent Documents 2 and 3). In this controlling method, compressed data is fetched into a rate buffer at a variable rate, and the bit transmission rate of the compressed data is amended depending on the sufficiency of the rate buffer. In this process, the bit transmission rate can be amended by selecting one of a plurality of quantizers.
FIG. 5 illustrates an example of a configuration of a hypothetical image compression device obtained by combining a circuit for switching between two predictors and a circuit for switching between two quantizers. The image compression device includes a buffer 501, predictors 502-1 and 502-2, selection units 503, 505, and 507, a mode determination unit 504, quantizers 506-1 and 506-2, a variable length coder 508, a rate buffer 509, and a rate controller 510.
The buffer 501 stores pixels of one line or one frame of the input image data, and the predictors 502-1 and 502-2 output a prediction error of a target pixel based on different prediction algorithms. The mode determination unit 504 switches the selection unit 503 depending on the prediction errors of the predictors 502-1 and 502-2, and outputs one of the prediction errors to the selection unit 505.
The quantizers 506-1 and 506-2 quantize a prediction error by different quantizing step widths, and the variable length coder 508 converts a quantization representative value into a variable length code and outputs the code to the rate buffer 509. The rate controller 510 switches the selection units 505 and 507 depending on the sufficiency of the rate buffer 509, and selects the quantizer 506-1 or 506-2.
With the configuration above, both the predictor and the quantizer can be selectively switched, but there are the following problems.
(1) Since the compression efficiency depends on the selected predictor, the compression rate can be improved for the signals (images) of different characteristics by switching predictors. However, an amount of generated code depends on the predictor, and the mode determination unit 504 cannot monitor the amount of generated code. Therefore, the amount of code cannot be adjusted by the switching of the predictors.
(2) The rate controller 510 starts controlling the reduction of a transmission rate only when the sufficiency of the rate buffer 509 becomes high enough. Therefore, immediately after the start of the compression, a small quantizing step width is set, and a generated code amount 601 exceeds an average generated code amount 602, and the image quality is excessively high as indicated by an arrow 603 in FIG. 6. On the other hand, when the sufficiency of the rate buffer 509 becomes high, the quantizing step width becomes locally large, and the generated code amount 601 decreases and the image quality can be excessively degraded as indicated by an arrow 604. Especially, when there frequently occurs a dot fluctuation as in CG images, the prediction accuracy is degraded, thereby suddenly degrading the image quality.
Furthermore, there is a method of determining a quantizing step width from the prediction error of a predictor (for example, refer to Patent Document 4). In this method, a predictor is determined for each block obtained by segmenting an input voice signal at predetermined time intervals, and the quantizing step width is determined from the prediction error of the predictor. Then, with the determined predictor and quantizing step width, the voice signal of the block is compressed.
In this case, since the block referred to when the quantizing step width is determined is the same as the block to be quantized with the determined quantizing step width, the quantization is performed only according to local information (block). Since the quantizing step width is determined depending on the local information, there is the possibility of frequent occurrences of a change in step width (or the change width becomes large). Therefore, output data can be degraded in image quality.
Patent Document 1: Specification of Japanese Patent No. 3228943
Patent Document 2: Japanese Laid-open Patent Publication No. 8-298465
Patent Document 3: Specification of U.S. Pat. No. 4,093,962
Patent Document 4: Japanese Laid-open Patent Publication No. 10-20893